package com.ml.mall.service.variant;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.bean.res.product.SysProductQueryTreeRes;
import com.ml.mall.bean.vo.variant.SysProductVariantSalesVo;
import com.ml.mall.entity.variant.SysProductVariantSales;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
* <p>
    *  服务类
    * </p>
*
* @author kyyang
* Created 2021-05-19
*/
public interface SysProductVariantSalesService extends IService<SysProductVariantSales> {


    /**
     * @description: 根据 sku 查询是否有 限时促销
     * 返回空 则没有 否则为 促销价
     * @author kyyang
     * @date 2021/5/27 22:04
     * @version 1.0
     */
    BigDecimal  getCurPromoByVariantId(Long variantId);


    /**
     * @description: 添加促销
     * @author zz
     * @date 2021/8/20
     * @version 1.0
     */
    void saveSysProductVariantSales(SysProductVariantSalesVo sysProductVariantSalesVo, Long promoid, Long variantId, Integer vid);


    Boolean checkSales(SysProductVariantSalesVo sysProductVariantSales);

    Boolean checkSalesByUpdate(SysProductVariantSalesVo sysProductVariantSales);
}
